Skip to content

Remove redundant tests from Task SDK#68504

Open
shahar1 wants to merge 1 commit into
apache:mainfrom
shahar1:remove-redundant-task-sdk-tests
Open

Remove redundant tests from Task SDK#68504
shahar1 wants to merge 1 commit into
apache:mainfrom
shahar1:remove-redundant-task-sdk-tests

Conversation

@shahar1

@shahar1 shahar1 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Human Summary

related: #68502.

This PR removes tests that are exact or near-exact duplicates of sibling tests
already asserting the same behavior — they add maintenance cost without adding
coverage.

Following review feedback, tests that guard against a library or attrs-generated
behavior change (equality, hashing, repr, exception-hierarchy catches, attribute
round-trips) are kept; only true duplicates are removed. Summarizing table is in
the "AI Summary".

AI Summary

Click Here

Legend — patterns:

  • P5 Exact or near-exact duplicate function
Test File : line Pattern Why redundant
test_build_task_group_with_prefix_functionality test_taskgroup.py P5 Near-exact duplicate of test_build_task_group_with_prefix: same Dag structure, same 7 assertions, only the Dag name string and inline comments differ
test_override_dag_default_args test_taskgroup.py P5 Byte-identical body to test_default_args (same Dag, same TaskGroup default_args, same three owner assertions); only the name and docstring differ
test_mask_secret_with_list test_comms.py P5 Fully subsumed by the parametrized test_mask_secret_with_objects, which already covers a list input alongside dict and string cases
test_mask_secret_with_iterable test_comms.py P5 Literal duplicate of test_mask_secret_with_list: identical setup example_dict = ["test"] and identical assertion — claims to test an iterable but uses the same list

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

@shahar1 shahar1 requested a review from jscheffl June 13, 2026 12:35
@eladkal eladkal added this to the Airflow 3.3.0 milestone Jun 15, 2026
@eladkal eladkal added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Jun 15, 2026
@shahar1 shahar1 requested a review from eladkal June 17, 2026 08:49
@shahar1 shahar1 force-pushed the remove-redundant-task-sdk-tests branch from 9e28a55 to 996b89e Compare June 27, 2026 12:42

@nailo2c nailo2c left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the idea in #68502.

Comment thread task-sdk/tests/task_sdk/definitions/test_wait_policy.py

@Lee-W Lee-W left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel we should keep P1 cases. We've been bitten by lib from time to time. P2 might be able to be removed in some cases, but it also ensure the value is not changed during object creation. totally agree with P5

related: apache#68502

These tests are exact or near-exact duplicates of sibling tests that
already assert the same behavior, so they add maintenance cost without
adding coverage:

- test_mask_secret_with_list / test_mask_secret_with_iterable duplicate
  each other and are subsumed by the parametrized test_mask_secret_with_objects.
- test_build_task_group_with_prefix_functionality duplicates
  test_build_task_group_with_prefix.
- test_override_dag_default_args is byte-identical to test_default_args.

Tests that guard against a library or attrs-generated behavior change
(equality, hashing, repr, exception-hierarchy catches, attribute
round-trips) are kept, per review feedback.

Generated-by: Claude Code (Opus 4.8)
@shahar1 shahar1 force-pushed the remove-redundant-task-sdk-tests branch from a3eec60 to 3d26f48 Compare July 2, 2026 12:42
@shahar1 shahar1 requested a review from Lee-W July 2, 2026 12:45

@SameerMesiah97 SameerMesiah97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked each of the test files you are removing these tests from and can confirm all 4 are redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:task-sdk changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants